package com.leyou.item.service.impl;

import com.leyou.item.pojo.Specification;
import com.leyou.item.mapper.SpecificationMapper;
import com.leyou.item.service.SpecificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SpecificationServiceImpl implements SpecificationService {

    @Resource
    private SpecificationMapper specificationMapper;

    //根据ID查询规格参数
    @Override
    public Specification queryById(Long id) {
        return specificationMapper.selectByPrimaryKey(id);
    }

    //新增
    @Override
    public void addSpec(Specification specification) {
        specificationMapper.insert(specification);
    }


    //更新
    @Override
    public void updateSpec(Specification specification) {
        specificationMapper.updateByPrimaryKeySelective(specification);
    }

    //删除
    @Override
    public void deleteSpec(Specification specification)  {
        specificationMapper.deleteByPrimaryKey(specification);
    }



}
